#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QCloseEvent>
#include <QMainWindow>
#include <QSettings>
#include <QSplitter>
#include <QTableView>
#include <QTreeView>

#include "src/ctextbrowser.h"
#include "src/ctableview.h"
#include "src/ctreeview.h"

#include <QtDebug>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QSettings*, QWidget *parent = 0);
    ~MainWindow();

    CTextBrowser* textBrowser();
    CTableView* tableView();
    CTreeView* treeView();

    QSplitter* hSplitter();
    QSplitter* vSplitter();

    void show();

    void setTitle(QString);

protected:
    void changeEvent(QEvent *e);
    void closeEvent(QCloseEvent *e);

private:
    Ui::MainWindow *m_ui;
    QSettings *m_set;
    QString m_defTitle;

    void debug(QString msg) const { qDebug() << "[MainWindow]\t" + msg; }

signals:
    void closed();
};

#endif // MAINWINDOW_H
